package com.xiaoyy.core.common.enums;
/**
 * 有效状态
 * @author chenzh
 * @date 2018-08-12
 * */
public enum BoolEnum {
    TRUE("1","有效/启用/是"),
    FALSE("0","无效/锁定/否");
    private String type;
    private String name;

    BoolEnum(String type, String name) {
        this.type = type;
        this.name = name;
    }

    public String getType() {
        return this.type;
    }

    public String getName() {
        return this.name;
    }

    public static BoolEnum getByType(String type) {

        for (BoolEnum typeEnum : values()) {
            if (typeEnum.getType() .equals(type) ) {
                return typeEnum;
            }
        }
        return null;
    }
}
